import './assets/main.css'
import './assets/tailwind.css'
import { createApp } from 'vue'
import pinia from '@/pinia'
import elementPlus from 'element-plus'
import ucElementPlus from './uc-element-plus'

import App from './App.vue'
import router from './router'
const app = createApp(App)

// 全局自定义指令, 一共包括7个钩子函数
app.directive('color', {
  created() {
    console.log('created-0')
  },
  beforeMount() {
    console.log('created-1')
  },
  mounted() {
    console.log('created-2')
  },
  beforeUpdate() {
    console.log('beforeUpdate-3')
  },
  updated(el, binding) {
    if (binding.value === 'red') {
      el.style.color = 'red'
    } else {
      el.style.color = '#333'
    }
  },
  beforeUnmount() { },
  unmounted() { }
})
app.config.globalProperties.globalInfo = {
  userName: 'zhangli'
}
app.use(pinia)
app.use(router)
app.use(elementPlus)
app.use(ucElementPlus)

app.mount('#app')
